package com.ease.model.criteria;

import com.ease.common.enums.EnumUtil;
import com.ease.common.enums.ValuableEnum;

/**
 * 
 * @author nathanleewei
 */
public enum CriteriaType implements ValuableEnum {

	Ignore((short) 0), //
	Positive((short) 10), //
	PrimaryKey((short) 11), //
	ForeignKey((short) 12), //
	Equal((short) 21), //
	NotEqual((short) 22), //
	Like((short) 23), //
	Greaterthan((short) 24), //
	Lessthan((short) 25), //
	LessthanOrEqual((short) 26), //
	GreaterthanOrEqual((short) 27), //
	In((short) 30), //
	IsNull((short) 31), //
	IsNotNull((short) 32), //
	Between((short) 30), //
	NativeSql((short) 40);

	private short value;

	private CriteriaType(short value) {
		this.value = value;
	}

	public static CriteriaType get(short value) {
		return EnumUtil.get(CriteriaType.class, value);
	}

	public static CriteriaType get(String name) {
		return EnumUtil.get(CriteriaType.class, name);
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name();
	}

	/**
	 * @return the value
	 */
	public short getValue() {
		return value;
	}

}
